package com.atues.thread.state;

public class TestPriority {

    public static void main(String[] args) {

        //优先级并不一定代表最先执行

        MyPriority myPriority = new MyPriority();
        Thread thread = new Thread(myPriority, "小红");
        thread.setPriority(1);

        Thread thread1 = new Thread(myPriority, "小明");
        thread1.setPriority(2);

        Thread thread2 = new Thread(myPriority, "小lan");
        thread2.setPriority(3);

        thread2.start();
        thread1.start();
        thread.start();
    }
}

class MyPriority implements Runnable {
    @Override
    public void run() {

            System.out.println(Thread.currentThread().getName() + " " );

    }


}
